<!-- appointment 页面内容 -->

<section class="appointment" ng-controller="appointmentCtrl">
    <div class="row margin-reset">
        <div class="col col-sm-offset-1 col-sm-5 col-xs-offset-1 col-xs-5">
            估价
        </div>
        <div class="col col-sm-5 col-xs-5 text-right" ng-bind="data.total">
        </div>
    </div>
    <div class="row grey-line margin-reset">
        <div class="col col-sm-offset-1 col-sm-5 col-xs-offset-1 col-xs-5">
            上门时间
        </div>
        <div ng-if="!service.mount_order" class="col col-sm-5 col-xs-5 text-right" ng-bind="data.booking_date * 1000 | date: 'yyyy-MM-dd HH:mm'">
        </div>
        <div ng-if="service.mount_order" class="col col-sm-5 col-xs-5 text-right" ng-bind="data.install_date * 1000 | date: 'yyyy-MM-dd HH:mm'">
        </div>
    </div>
    <div class="row margin-reset">
        <div class="col col-sm-offset-1 col-sm-5 col-xs-offset-1 col-xs-5">
            预约人
        </div>
        <div class="col col-sm-5 col-xs-5 text-right" ng-bind="data.name">
        </div>
    </div>
    <div class="row grey-line margin-reset">
        <div class="col col-sm-offset-1 col-sm-5 col-xs-offset-1 col-xs-5">
            手机
        </div>
        <div class="col col-sm-5 col-xs-5 text-right" ng-bind="data.tel">
        </div>
    </div>

    <div class="row margin-reset text-center" ng-if='user_role != 0 || user.company_id'>
        <label class="radio-inline">
        <input type="radio" ng-model='data.public_order' id="open_order" ng-value="true" ng-click="cleanMaster();"> 公开订单
      </label>
        <label class="radio-inline">
        <input type="radio" ng-model='data.public_order' id="taken_order" ng-value="false" data-toggle="modal" data-target="#servermodal"> 指派订单
      </label>

    </div>

    <div class="row margin-reset text-center" ng-show='master'>
        <span class="caret-up"></span>
        <div class="server-info col-sm-offset-3 col-sm-6 col-xs-12">
            已指派服务商
            <span class="name" ng-bind="master.real_name"></span>
            <span class="tel" ng-bind="master.tel"></span>
        </div>
    </div>

    <div class="row margin-reset button-arrows">
        <div class="col-sm-offset-1 col-sm-4 col-xs-6">
            <button type="button" class='btn btn-block button-arrows-left' ng-click="goBackInformatgion();">
              <span class="icon-left-arrow"></span>
              上一步
            </button>
        </div>
        <div class="col-sm-offset-1 col-sm-4 col-xs-6">
            <button type="submit" class='btn btn-block button-arrows-right' ng-click="getAppoint();">
              立即预约
              <span class="icon-right-arrow"></span>
            </button>
        </div>

        <div class="modal fade common-modal" id="servermodal" tabindex="-1" role="dialog" aria-labelledby="common-modal">
            <div class="modal-dialog" role="document">
                <div class="modal-content yf-shadow">
                    <div class="modal-header text-center">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h3 class="modal-title" id="common-modal">
                              指定服务商
                        </h3>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-lg-offset-1 col-lg-10 col-md-offset-1 col-md-10 col-sm-offset-1 col-sm-10 col-xs-12">
                              <form role="form" class="search-input-group">
                                  <div class="input-group">
                                      <input type="search" class="form-control mt_input" ng-model='keyword' ng-enter="getMaster(keyword);" placeholder="输入师傅的账号">
                                      <span class="input-group-btn">
                                          <button class="btn mt_group_btn" type="button" ng-click="getMaster(keyword);">搜索</button>
                                      </span>
                                  </div>
                              </form>
                            </div>
                            <div class="col-lg-offset-1 col-lg-10 col-md-offset-1 col-md-10 col-sm-offset-1 col-sm-10 col-xs-12" ng-show='noperson' ng-bind='noperson' style="color: red;">
                            </div>
                            <div class="col-lg-offset-1 col-lg-10 col-md-offset-1 col-md-10 col-sm-offset-1 col-sm-10 col-xs-12">
                              <table class="table table-striped table-bordered table-condensed">
                                  <thead ng-if="masters">
                                      <th>账号</th>
                                      <th>姓名</th>
                                  </thead>
                                  <tr ng-repeat="master in masters track by $index">
                                      <td ng-click="setMaster(master);">{{master.tel}}</td>
                                      <td ng-click="setMaster(master);">{{master.real_name}}</td>
                                  </tr>
                              </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
</section>
